package com.ruoyi.weixin.juc2;
import java.text.SimpleDateFormat;
import java.util.Date;

public class MyThread extends Thread {

    private SimpleDateFormat sdf;
    private String dateString;

    MyThread(SimpleDateFormat sdf, String dateString) {
        super();
        this.dateString = dateString;
        this.sdf = sdf;
    }

    public void run() {
        try {
            Date dateRef = sdf.parse(dateString);
            String newDate = sdf.format(dateRef).toString();
            if (!newDate.equals(dateString)) {
                System.out.println("Threadneme" + this.getName() + "报错了" + dateString + "转换为" + newDate);
            }
        } catch (java.text.ParseException e) {
            e.printStackTrace();
        }
    }


}
